using System; 
using System.Drawing; 
using System.Collections; 
using System.ComponentModel; 
using System.Windows.Forms; 
using System.Data.SqlClient;
using System.Data;
using PointOfSale.Global; 
using CrystalDecisions.Shared; 
using CrystalDecisions.CrystalReports.Engine;

namespace PointOfSale.Report.Menu
{
	/// <summary>
	/// Summary description for frmMenuToday.
	/// </summary>
	public class frmMenuToday : System.Windows.Forms.Form
	{
		private CrystalDecisions.Windows.Forms.CrystalReportViewer crystalReportViewer1;
		private System.ComponentModel.Container components = null;

		string report_file = "";
		ReportDocument crReportDocument = new ReportDocument();

		public frmMenuToday()
		{
			InitializeComponent();
		}

		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.crystalReportViewer1 = new CrystalDecisions.Windows.Forms.CrystalReportViewer();
			this.SuspendLayout();
			// 
			// crystalReportViewer1
			// 
			this.crystalReportViewer1.ActiveViewIndex = -1;
			this.crystalReportViewer1.DisplayGroupTree = false;
			this.crystalReportViewer1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.crystalReportViewer1.Location = new System.Drawing.Point(0, 0);
			this.crystalReportViewer1.Name = "crystalReportViewer1";
			this.crystalReportViewer1.ReportSource = null;
			this.crystalReportViewer1.Size = new System.Drawing.Size(744, 453);
			this.crystalReportViewer1.TabIndex = 0;
			// 
			// frmMenuToday
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(744, 453);
			this.Controls.Add(this.crystalReportViewer1);
			this.Name = "frmMenuToday";
			this.Text = "frmMenuToday";
			this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
			this.Load += new System.EventHandler(this.frmMenuToday_Load);
			this.ResumeLayout(false);

		}
		#endregion

		private void frmMenuToday_Load(object sender, System.EventArgs e)
		{
			Report.Menu.rptMenuToday crReportDocument = new Report.Menu.rptMenuToday();
			
			String strSelect = "SELECT TodayCode AS ItemCode, ItemName, Rate FROM  tblItem, tblRate, tblSetupMenuToday " +
				"WHERE (tblItem.ItemId = tblSetupMenuToday.Id) AND " +
				" (tblItem.ItemId = tblRate.ItemId) AND " +
				"(tblSetupMenuToday.DepartmentId = " + clsGlobal.g_DepartmentId + ") ORDER BY TodayCode";
			DataTable dt = clsDatabase.GetDataToTable(strSelect, clsGlobal.g_DataConn);

			crReportDocument.SetDataSource(dt);
			crystalReportViewer1.ReportSource = crReportDocument;

		}
	}
}
